<template>
	<view>
		<button @click="getUserInfo()">获取权限</button>

	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			getUserInfo() {
				let that = this
				uni.getUserProfile({
					desc: "weixin", // 指明用途,这个参数是必须的
					success: function(res) {
						that.nickName = res.userInfo.nickName
						that.avatarUrl = res.userInfo.avatarUrl
						console.log(res.userInfo)
					}
				})
			}

		}
	}
</script>

<style lang="scss">

</style>
